package com.cloudfun.campusshare.configuration.config;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory;

import javax.annotation.PostConstruct;

/**
 * Created by Huqin on 2020/5/29
 */
@Configuration
public class RedisConfig {

    @Autowired
    private LettuceConnectionFactory connectionFactory;

    @PostConstruct
    public void getConnectionFactory() {
        connectionFactory.setValidateConnection(true);
    }

}
